
struct MultiCast {
    addr: String
}

impl MultiCast {
    fn new(addr: &str) -> Self {
        Self {
            addr: addr.to_string()
        }
    }
    fn send(&self, _buf: &[u8]){ // to write trait
    }
    fn recv(&self, _mbuf: &mut [u8]) { //to read  trait
    }

    fn print(&self) {
        println!("{}", self.addr)
    }
}




fn main() {
    let saddr = "223.0.0.8:5234";
    let mc = MultiCast::new(saddr);
    mc.print();
    loop {
        mc.send("hello".as_bytes());
        let mut buf = [0;10];
        mc.recv(&mut buf);
        break;
    }
    println!("Hello, world!");
}
